﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SimpleTaskSystem
{
    public class OperationMessage : MonoBehaviour{
        public static Dictionary<string, Operation> operationDic = new Dictionary<string, Operation>();
        //public static Operation.OperationHandler oneOperationCompleted;

        public static void AddOperation(Operation operation)
        {
            operationDic.Add(operation.operationName, operation);
        }
        public static void OperationCompleted(string operationName)
        {
            Debug.Log(operationName);
            operationDic[operationName].OnCompleted();
            //if (oneOperationCompleted != null)
            //{
            //    oneOperationCompleted(operationDic[operationName]);
            //}
        }

        public void SendOperationMessage(string operationName)
        {
            OperationCompleted(operationName);
        }

    }
}
